#ifndef __RPC_TRANSMISSION_H__
#define __RPC_TRANSMISSION_H__

#include "ret.h"
#include "transmission/tcp_server.h"

extern char g_transmission_running_flag;

typedef enum {
    TRANSMISSION_TCP,
    TRANSMISSION_PIPELINE,
    TRANSMISSION_SHMEM,
    TRANSMISSION_UNKOWN
}transmission_type_t;

typedef void* transmission_server_config_t;

typedef void* transmission_server_t;

transmission_server_t transmission_server_create(
    const transmission_type_t type,
    transmission_server_config_t config);

ret_t transmission_server_start(const transmission_type_t type,
    transmission_server_t server);

void transmission_server_destroy(
    const transmission_type_t type,
    transmission_server_t* t);

ret_t remote_execute_asynchronous();
ret_t remote_execute_synchronous();
ret_t remote_execute_synchronous_with_timeout();

ret_t cmd_send(const char *msg, int len);
ret_t cmd_recv(char *msg, int len);

#endif // __RPC_TRANSMISSION_H__